package com.highper.common.configuration;

import cn.dev33.satoken.id.SaIdUtil;
import cn.dev33.satoken.stp.StpUtil;
import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean;

/**
 * @Author ZhangGJ
 * @Date 2022/01/29 10:29
 */
public class FeignConfigure {

    @Bean
    public RequestInterceptor feignInterceptor() {
        return requestTemplate -> {
            requestTemplate.header(SaIdUtil.ID_TOKEN, SaIdUtil.getToken());
            requestTemplate.header("token", StpUtil.getTokenValue());
        };
    }
}
